package com.yuchting.dinneronline.server;

import java.util.Collections;

import javax.cache.Cache;
import javax.cache.CacheException;
import javax.cache.CacheFactory;
import javax.cache.CacheManager;

public class MainServiceCache{
	
	private static Cache			sm_cacheInstance = null;
	
	static public synchronized Cache queryCache()throws CacheException{
		if(sm_cacheInstance == null){
			CacheFactory cacheFactory = CacheManager.getInstance().getCacheFactory();
			sm_cacheInstance = cacheFactory.createCache(Collections.emptyMap());
		}
		
		return sm_cacheInstance;
	}
	
	
}
